<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Attribute 绑定</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <style>
        .one{
            color:red;
        }
        .two{
            color: blue;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1 v-bind:class="titleClass">{{xxx}}</h1>
        <button v-on:click="oneclick">one</button>
        <button v-on:click="twoclick">two</button>
    </div>
    <script>
        const {createApp} = Vue
        createApp({
            data(){
                return{
                    xxx:'hello',
                    titleClass:'two'
                }
            },
            methods:{
                oneclick(){
                    // alert('one')
                    this.titleClass = 'one'
                    this.xxx = '一'
                },
                twoclick(){
                    // alert('two')
                    this.titleClass = 'two'
                    this.xxx = '二'
                }
            }
        }).mount('#app')
    </script>
</body>
</html>